<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: Core locking and MPU</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__lwip__opts__lock.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a>  </div>
  <div class="headertitle">
<div class="title">Core locking and MPU<div class="ingroups"><a class="el" href="group__lwip.html">lwIP</a> &raquo; <a class="el" href="group__lwip__opts.html">Options (lwipopts.h)</a> &raquo; <a class="el" href="group__lwip__opts__infrastructure.html">Infrastructure</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gae9afcefa5d233372abb9413188dd98c9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__opts__lock.html#gae9afcefa5d233372abb9413188dd98c9">LWIP_MPU_COMPATIBLE</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:gae9afcefa5d233372abb9413188dd98c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8e46232794349c209e8ed4e9e7e4f011"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__opts__lock.html#ga8e46232794349c209e8ed4e9e7e4f011">LWIP_TCPIP_CORE_LOCKING</a>&#160;&#160;&#160;1</td></tr>
<tr class="separator:ga8e46232794349c209e8ed4e9e7e4f011"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga351beb1c06affe49e717bc9f76c66acf"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__opts__lock.html#ga351beb1c06affe49e717bc9f76c66acf">LWIP_TCPIP_CORE_LOCKING_INPUT</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:ga351beb1c06affe49e717bc9f76c66acf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae85efb3a5fcf8585c94b3c2669978959"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__opts__lock.html#gae85efb3a5fcf8585c94b3c2669978959">SYS_LIGHTWEIGHT_PROT</a>&#160;&#160;&#160;1</td></tr>
<tr class="separator:gae85efb3a5fcf8585c94b3c2669978959"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6a30040db307b3459fc11906bd433f75"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__opts__lock.html#ga6a30040db307b3459fc11906bd433f75">LWIP_ASSERT_CORE_LOCKED</a>()</td></tr>
<tr class="separator:ga6a30040db307b3459fc11906bd433f75"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab97d014f7ecf3b20f9d5abc2d0a79a3e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__opts__lock.html#gab97d014f7ecf3b20f9d5abc2d0a79a3e">LWIP_MARK_TCPIP_THREAD</a>()</td></tr>
<tr class="separator:gab97d014f7ecf3b20f9d5abc2d0a79a3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga6a30040db307b3459fc11906bd433f75"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6a30040db307b3459fc11906bd433f75">&#9670;&nbsp;</a></span>LWIP_ASSERT_CORE_LOCKED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_ASSERT_CORE_LOCKED</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Macro/function to check whether lwIP's threading/locking requirements are satisfied during current function call. This macro usually calls a function that is implemented in the OS-dependent sys layer and performs the following checks:</p><ul>
<li>Not in ISR (this should be checked for NO_SYS==1, too!)</li>
<li>If <a class="el" href="group__lwip__opts__lock.html#ga8e46232794349c209e8ed4e9e7e4f011">LWIP_TCPIP_CORE_LOCKING</a> = 1: TCPIP core lock is held</li>
<li>If <a class="el" href="group__lwip__opts__lock.html#ga8e46232794349c209e8ed4e9e7e4f011">LWIP_TCPIP_CORE_LOCKING</a> = 0: function is called from TCPIP thread <dl class="section see"><dt>See also</dt><dd><a class="el" href="multithreading.html">Multithreading</a> </dd></dl>
</li>
</ul>

</div>
</div>
<a id="gab97d014f7ecf3b20f9d5abc2d0a79a3e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab97d014f7ecf3b20f9d5abc2d0a79a3e">&#9670;&nbsp;</a></span>LWIP_MARK_TCPIP_THREAD</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_MARK_TCPIP_THREAD</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Called as first thing in the lwIP TCPIP thread. Can be used in conjunction with <a class="el" href="group__lwip__opts__lock.html#ga6a30040db307b3459fc11906bd433f75">LWIP_ASSERT_CORE_LOCKED</a> to check core locking. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="multithreading.html">Multithreading</a> </dd></dl>

</div>
</div>
<a id="gae9afcefa5d233372abb9413188dd98c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae9afcefa5d233372abb9413188dd98c9">&#9670;&nbsp;</a></span>LWIP_MPU_COMPATIBLE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_MPU_COMPATIBLE&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>LWIP_MPU_COMPATIBLE: enables special memory management mechanism which makes lwip able to work on MPU (Memory Protection Unit) system by not passing stack-pointers to other threads (this decreases performance as memory is allocated from pools instead of keeping it on the stack) </p>

</div>
</div>
<a id="ga8e46232794349c209e8ed4e9e7e4f011"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8e46232794349c209e8ed4e9e7e4f011">&#9670;&nbsp;</a></span>LWIP_TCPIP_CORE_LOCKING</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_TCPIP_CORE_LOCKING&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>LWIP_TCPIP_CORE_LOCKING Creates a global mutex that is held during TCPIP thread operations. Can be locked by client code to perform lwIP operations without changing into TCPIP thread using callbacks. See <a class="el" href="tcpip_8h.html#a4700525e737fc025fea4887b172e0c95">LOCK_TCPIP_CORE()</a> and <a class="el" href="tcpip_8h.html#a915effea029b9c4891e1ec635eb1826d">UNLOCK_TCPIP_CORE()</a>. Your system should provide mutexes supporting priority inversion to use this. </p>

</div>
</div>
<a id="ga351beb1c06affe49e717bc9f76c66acf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga351beb1c06affe49e717bc9f76c66acf">&#9670;&nbsp;</a></span>LWIP_TCPIP_CORE_LOCKING_INPUT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_TCPIP_CORE_LOCKING_INPUT&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>LWIP_TCPIP_CORE_LOCKING_INPUT: when LWIP_TCPIP_CORE_LOCKING is enabled, this lets <a class="el" href="group__lwip__os.html#gae510f195171bed8499ae94e264a92717">tcpip_input()</a> grab the mutex for input packets as well, instead of allocating a message and passing it to tcpip_thread.</p>
<p>ATTENTION: this does not work when <a class="el" href="group__lwip__os.html#gae510f195171bed8499ae94e264a92717">tcpip_input()</a> is called from interrupt context! </p>

</div>
</div>
<a id="gae85efb3a5fcf8585c94b3c2669978959"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae85efb3a5fcf8585c94b3c2669978959">&#9670;&nbsp;</a></span>SYS_LIGHTWEIGHT_PROT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SYS_LIGHTWEIGHT_PROT&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SYS_LIGHTWEIGHT_PROT==1: enable inter-task protection (and task-vs-interrupt protection) for certain critical regions during buffer allocation, deallocation and memory allocation and deallocation. ATTENTION: This is required when using lwIP from more than one context! If you disable this, you must be sure what you are doing! </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
